package kr.hkit.androidcomplete02.ch16;

import kr.hkit.androidcomplete02.R;
import android.app.Activity;
import android.app.AlertDialog;
import android.os.Bundle;
import android.view.View;

public class TouchOutside extends Activity {
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.ch16_alertdialog);
	}
	
	public void mOnClick(View v){
		AlertDialog dialog = new AlertDialog.Builder(this)
		.setTitle("알림")
		.setMessage("대화상자 외부를 누르면 닫힙니다.")
		.setCancelable(false)
		.setIcon(R.drawable.androboy)
		.setNegativeButton("닫기", null)
		.create();
		
		dialog.setCanceledOnTouchOutside(true);
		dialog.show();
	}
}
